﻿using System;
using System.Web;
using WAD.Model;
using WAD.WEB.AppCode;
using WAD.DAL;

namespace QD.Weijie.Web.WSite.ajax
{
    /// <summary>
    /// Bankroll 的摘要说明
    /// </summary>
    public class Bankroll : PassportAjax
    {
        public override void AjaxMethodDispatch(String identity)
        {
            switch (identity)
            {
                case "getlist_new": this.GetList_New(); break;
                case "getlist": this.GetList(); break;
            }
        }
        [QD.Web.Ajax.AjaxMethod]
        public void GetList_New()
        {
          //  WAD.DAL.Union.DAOAgentRecord.GetList();
        }

        [QD.Web.Ajax.AjaxMethod]
        public void GetList()
        {
            int pagesize = 20;
            int page = Parse.Int("page", 1);
            int direction = Parse.Int("type", 0);
            string where = "agentid=" + UserId;
            if (direction > 0)
                where += " and direction=" + direction;
            PageData dt = DAO.GetListPage("id,agentid,amount,balance,direction,itemid,remarks,userip,addtime", "id desc", page, pagesize, where, "Agent_Record");
            JsonResult(0, "", dt);
        }

    }
}